package com.webserver.http;

import java.security.PrivateKey;
import java.util.HashMap;
import java.util.Map;

public class HttpContext {
    //回车符
    public static final char CR = 13;
    //换行符
    public static final char LF = 10;

    private static Map<String,String> mimeMapping = new HashMap<>();

    static{
        initMimeMapping();
    }

    private static void initMimeMapping(){
        mimeMapping.put("html", "text/html");
        mimeMapping.put("css", "text/css");
        mimeMapping.put("js", "application/javascript");
        mimeMapping.put("png", "image/png");
        mimeMapping.put("gif", "image/gif");
        mimeMapping.put("jpg", "image/jpeg");
    }

    public static String getMimeType(String ext){
        return mimeMapping.get(ext);
    }
}